package com.stedu.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.stedu.group.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

@AllArgsConstructor
@Data
@NoArgsConstructor
/**
 * 游戏表
 * @TableName Games
 */
public class Games {
    /**
     * 主键
     */
    @NotNull(message = ("ID不为空"),groups = UpdateGroup.class)
    private Long gid;

    /**
     * 版号
     */
    @NotBlank(message = ("版号不为空"),groups = UpdateGroup.class)
    private String gnum;

    /**
     * 姓名
     */
    @NotBlank(message = ("姓名不为空"))
    private String gname;



    /**
     * 兴趣程度
     */
    @NotBlank(message = ("兴趣不为空"))
    private String interest;

    /**
     * 游戏类型
     */
    @NotBlank(message = ("游戏类型不为空"))
    private String gtype;

    /**
     * 发行时间
     */
    @NotNull(message = "发行时间不为空")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date reldate;

    /**
     * 营收
     */
    @NotNull(message = "营收金额不能为空")
    @DecimalMin(value = "0.01", message = "营收金额必须大于等于0.01")
    @DecimalMax(value = "9999999999", message = "营收金额必须小于等于99999999.99")
    private BigDecimal revenue;

    /**
     * 上架状态(1.上架 2.下架)
     */
    @Min(value = 1,message = "最小值为1")
    @Max(value = 2,message = "最大值为2")
    private Integer estate;

    /**
     * 平台编号
     */
    @NotNull(message = "游戏平台不为空")
    private Integer plaid;
    /**
     * 部门信息
     */
    @Valid

    private GamingPlatform gamingPlatform;
}
